import BasicLayout from "@/layouts/basic-layout";
import BasicList from "@/pages/list/basic-list";
import CardList from "@/pages/list/card-list";
import SearchList from "@/pages/list/search-list";
import Articles from "@/pages/list/search-list/articles";
import Projects from "@/pages/list/search-list/projects";
import { Navigate } from "react-router-dom";
import type { RouteObject } from "react-router-dom";



const route: RouteObject = {
    key: "/list",
    label: "列表页面",
    path: "/list",
    sort: 9998,
    element: <BasicLayout />,
    children: [
        {
            key: "",
            label: "",
            index: true,
            element: <Navigate to="basic-list" replace />,
        },
        {
            key: "/list/basic-list",
            label: "基础列表",
            path: "basic-list",
            element: <BasicList />,
        },
        {
            key: "/list/card-list",
            label: "卡片列表",
            path: "card-list",
            element: <CardList />,
        },
        {
            key: "/list/search-list",
            label: "搜索列表",
            path: "search-list",
            element: <SearchList />,
            children: [
                {
                    key: "",
                    label: "",
                    index: true,
                    element: <Navigate to="articles" replace />,
                },
                {
                    key: "/list/search-list/articles",
                    label: "搜索列表-文章",
                    path: "articles",
                    element: <Articles />,
                },
                {
                    key: "/list/search-list/projects",
                    label: "搜索列表-项目",
                    path: "projects",
                    element: <Projects />,
                },
            ],
        },
    ],
};

export default route;